function r(r, t) {
    return r >> t & 1;
}

function t() {
    var t, e, u, A, i = !1, g = (h = 3 != arguments.length ? new Date() : new Date(arguments[0], arguments[1], arguments[2])).getYear();
    for (g < 1900 && (g += 1900), t = 365 * (g - 1921) + Math.floor((g - 1921) / 4) + f[h.getMonth()] + h.getDate() - 38, 
    h.getYear() % 4 == 0 && h.getMonth() > 1 && t++, e = 0; ;e++) {
        for (u = A = c[e] < 4095 ? 11 : 12; u >= 0; u--) {
            if (t <= 29 + r(c[e], u)) {
                i = !0;
                break;
            }
            t = t - 29 - r(c[e], u);
        }
        if (i) break;
    }
    a = 1921 + e, n = A - u + 1, o = t, 12 == A && (n == Math.floor(c[e] / 65536) + 1 && (n = 1 - n), 
    n > Math.floor(c[e] / 65536) + 1 && n--);
}

function e() {
    var r = "";
    return r += u.charAt((a - 4) % 10), r += A.charAt((a - 4) % 12), r += "(", r += l.charAt((a - 4) % 12), 
    r += ")年 ", n < 1 ? (r += "(闰)", r += g.charAt(-n - 1)) : r += g.charAt(n - 1), 
    r += "月", r += o < 11 ? "初" : o < 20 ? "十" : o < 30 ? "廿" : "三十", o % 10 == 0 && 10 != o || (r += i.charAt((o - 1) % 10)), 
    r;
}

var a, n, o, h, c = new Array(100), f = new Array(12), u = "甲乙丙丁戊己庚辛壬癸", A = "子丑寅卯辰巳午未申酉戌亥", i = "一二三四五六七八九十", g = "正二三四五六七八九十冬腊", l = "鼠牛虎兔龙蛇马羊猴鸡狗猪";

c = new Array(2635, 333387, 1701, 1748, 267701, 694, 2391, 133423, 1175, 396438, 3402, 3749, 331177, 1453, 694, 201326, 2350, 465197, 3221, 3402, 400202, 2901, 1386, 267611, 605, 2349, 137515, 2709, 464533, 1738, 2901, 330421, 1242, 2651, 199255, 1323, 529706, 3733, 1706, 398762, 2741, 1206, 267438, 2647, 1318, 204070, 3477, 461653, 1386, 2413, 330077, 1197, 2637, 268877, 3365, 531109, 2900, 2922, 398042, 2395, 1179, 267415, 2635, 661067, 1701, 1748, 398772, 2742, 2391, 330031, 1175, 1611, 200010, 3749, 527717, 1452, 2742, 332397, 2350, 3222, 268949, 3402, 3493, 133973, 1386, 464219, 605, 2349, 334123, 2709, 2890, 267946, 2773, 592565, 1210, 2651, 395863, 1323, 2707, 265877), 
f[0] = 0, f[1] = 31, f[2] = 59, f[3] = 90, f[4] = 120, f[5] = 151, f[6] = 181, f[7] = 212, 
f[8] = 243, f[9] = 273, f[10] = 304, f[11] = 334, module.exports = function(r, a, n) {
    return r < 1921 || r > 2020 ? "" : (a = parseInt(a) > 0 ? a - 1 : 11, t(r, a, n), 
    e());
};